home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 October / CHIP Turkiye Ekim 2000.iso / prog / naps / 04 / setup.exe / Gnucleus / MainFrm.h < prev    next >
C/C++ Source or Header  |  2000-07-15  |  4KB  |  142 lines

  1. // MainFrm.h : interface of the CMainFrame class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_MAINFRM_H__1AE2E5CC_1AB4_11D4_ACF2_00A0CC533D52__INCLUDED_)
  6. #define AFX_MAINFRM_H__1AE2E5CC_1AB4_11D4_ACF2_00A0CC533D52__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12. // Why must I put this here, god why?
  13. #include "GnucleusDoc.h"
  14.  
  15. class CMainFrame : public CMDIFrameWnd
  16. {
  17.     DECLARE_DYNAMIC(CMainFrame)
  18. public:
  19.     CMainFrame();
  20.  
  21. // Attributes
  22. public:
  23.     UINT UpdateTimer;
  24.  
  25. // Operations
  26. public:
  27.     CDialogBar* GetDialogBar();
  28.    BOOL ShowTaskBarButton(BOOL bVisible);
  29.  
  30.    BOOL Enabled() { return m_bEnabled; }
  31.    BOOL Visible() { return !m_bHidden; }
  32.  
  33.    // Create the tray icon
  34.    CreateTrayIcon(CWnd* pParent, UINT uCallbackMessage, LPCTSTR szTip, HICON icon, UINT uID);
  35.  
  36.    // Change or retrieve the Tooltip text
  37.    BOOL    SetTooltipText(LPCTSTR pszTooltipText);
  38.    BOOL    SetTooltipText(UINT nID);
  39.    CString GetTooltipText() const;
  40.  
  41.    // Change or retrieve the icon displayed
  42.    BOOL  SetIcon(HICON hIcon);
  43.    BOOL  SetIcon(LPCTSTR lpszIconName);
  44.    BOOL  SetIcon(UINT nIDResource);
  45.    BOOL  SetStandardIcon(LPCTSTR lpIconName);
  46.    BOOL  SetStandardIcon(UINT nIDResource);
  47.    HICON GetIcon() const;
  48.    void  HideIcon();
  49.    void  ShowIcon();
  50.    void  RemoveIcon();
  51.    void  MoveToRight();
  52.  
  53.    // Change menu default item
  54.    void GetMenuDefaultItem(UINT& uItem, BOOL& bByPos);
  55.    BOOL SetMenuDefaultItem(UINT uItem, BOOL bByPos);
  56.  
  57.    // Change or retrieve the window to send notification messages to
  58.    BOOL  SetNotificationWnd(CWnd* pNotifyWnd);
  59.    CWnd* GetNotificationWnd() const;
  60.  
  61.    // Default handler for tray notification message
  62.    virtual LRESULT OnTrayNotification(WPARAM uID, LPARAM lEvent);
  63.  
  64. // Overrides
  65.     // ClassWizard generated virtual function overrides
  66.     //{{AFX_VIRTUAL(CMainFrame)
  67.     public:
  68.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  69.     protected:
  70.     virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  71.     virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  72.     //}}AFX_VIRTUAL
  73.  
  74. // Implementation
  75. public:
  76.     virtual ~CMainFrame();
  77.  
  78. #ifdef _DEBUG
  79.     virtual void AssertValid() const;
  80.     virtual void Dump(CDumpContext& dc) const;
  81. #endif
  82.  
  83. protected:  // control bar embedded members
  84.     CStatusBar  m_wndStatusBar;
  85.     CToolBar    m_wndToolBar;
  86.     CReBar        m_wndReBar;
  87.     CDialogBar    m_wndDlgBar;
  88.  
  89.     DWORD GetEstSpeed(DWORD);
  90.  
  91.     CGnucleusDoc *Doc;
  92.     UINT Strike;
  93.    BOOL m_bOwnerCreated;
  94.    CDialog m_MainFrameOwner;
  95.    BOOL m_bUseTrayIcon;
  96.  
  97.    // Tray Icon Implementation
  98.    CWnd              m_wndTrayIcon;
  99.    void              InitializeTrayIcon();
  100.    BOOL              m_bEnabled;   // does O/S support tray icon?
  101.    BOOL              m_bHidden;    // Has the icon been hidden?
  102.    NOTIFYICONDATA    m_tnd;
  103.  
  104.    HICON             m_IconList;
  105.    static UINT       m_nIDEvent;
  106.    int               m_nCurrentIcon;
  107.    HICON             m_hSavedIcon;
  108.    UINT              m_DefaultMenuItemID;
  109.    BOOL              m_DefaultMenuItemByPos;
  110.  
  111.        //
  112.     //  These functions draw the modified title bar.
  113.     //
  114.     void CalcCaptionRect( HWND hWnd, RECT& Rect );
  115.     void DrawIconize( HDC hDc, int x, int y, int off );
  116.     void DrawButtons( HWND hWnd );
  117.     BOOL m_LBtnDown;
  118.  
  119. // Generated message map functions
  120. protected:
  121.     //{{AFX_MSG(CMainFrame)
  122.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  123.     afx_msg void OnTimer(UINT nIDEvent);
  124.     afx_msg void OnOpenFromTray();
  125.     afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
  126.     afx_msg BOOL OnNcActivate(BOOL bActive);
  127.     afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
  128.     afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  129.     afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
  130.     afx_msg void OnNcPaint();
  131.     afx_msg void OnPaint();
  132.     //}}AFX_MSG
  133.     DECLARE_MESSAGE_MAP()
  134. };
  135.  
  136. /////////////////////////////////////////////////////////////////////////////
  137.  
  138. //{{AFX_INSERT_LOCATION}}
  139. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  140.  
  141. #endif // !defined(AFX_MAINFRM_H__1AE2E5CC_1AB4_11D4_ACF2_00A0CC533D52__INCLUDED_)
  142.